import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: {},
    LOADING: false, //loading加载状态
    title: '',
    showMoney: false,
    showMillMoney: false,
    showFilMoney: false,
    showJfMoney: false,
  },
  mutations: {
    setUser(state, val) {
      state.user = val
    },
    showLoading(state) {
      state.LOADING = true
    },
    SetshowJfMoney(state, val) {
      state.showJfMoney = val
    },
    SetshowFilMoney(state, val) {
      state.showFilMoney = val
    },
    SetShowMillMoney(state, val) {
      state.showMillMoney = val
    },
    setShowMoney(state, val) {
      state.showMoney = val
    },
    hideLoading(state) {
      state.LOADING = false
    },
    setTitle(state, value) {
      state.title = value
    },
  },
  actions: {},
  getters: {},
  plugins: [persistedState({ storage: window.localStorage })],
})
